package com.jymj.service.impl;

import com.jymj.dao.PjTaskFileDao;
import com.jymj.entity.gantt.PjtaskFile;
import com.jymj.service.PjTaskFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by ljj on 2017/8/28.
 */
@Service("pjTaskFileService")
public class PjTaskFileServiceImpl implements PjTaskFileService {

    @Autowired
    private PjTaskFileDao pjTaskFileDao;

    @Override
    public void save(PjtaskFile pjtaskFile) {
        pjTaskFileDao.save(pjtaskFile);
    }

    @Override
    public List<PjtaskFile> queryList(Integer id) {
        return pjTaskFileDao.queryList(id);
    }

    @Override
    public PjtaskFile queryObject(Integer id) {
        return pjTaskFileDao.queryObject(id);
    }

    @Override
    public void delete(Integer id) {
        pjTaskFileDao.delete(id);
    }

    @Override
    public List<PjtaskFile> appqueryList(Integer taskid) {
        return pjTaskFileDao.appqueryList(taskid);
    }

    @Override
    public void update(Integer id, Integer[] ids) {
        Map<String, Object> map = new HashMap<>();
        map.put("id", id);
        map.put("ids", ids);
        pjTaskFileDao.updateFile(map);
    }

    @Override
    public void deleteByDelId(Integer id) {
        pjTaskFileDao.deleteByDelId(id);
    }

    @Override
    public List<PjtaskFile> appFatherTask(Integer taskid, String code) {
        Map map = new HashMap();
        map.put("taskid", taskid);
        map.put("code", code);
        return pjTaskFileDao.appFatherTask(map);
    }

    @Override
    public List<PjtaskFile> queryFileByTid(Integer id) {
        return pjTaskFileDao.queryFileByTid(id);
    }

    @Override
    public void deleteByTid(Integer id) {
        pjTaskFileDao.deleteByTid(id);
    }
}
